/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.psi.action.supplychainmana;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.talent.util.data.*;
import cn.javaxc.psi.mapper.supplychainmana.WarehouseMapper;
public class WarehouseAction extends BaseAction
{
    @Autowired(required=false)
	private WarehouseMapper mapper;
    /**
    盘存任务设置
    */
    
    public Map warehouseList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_set=mapper.s_set(params);
        result.put("s_set", s_set);
        
        return result;
    }
    /**
    盘存修改
    */
    
    public Map inventoryListUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_set=mapper.t_set(params);
        SQLMap t_set_emt=t_set.getExistfirst();
        result.put("t_set", t_set_emt);
        
        
        SQLList<SQLMap> s_date=mapper.s_date(params);
        result.put("s_date", s_date);
        
        
        SQLList<SQLMap> s_price=mapper.s_price(params);
        result.put("s_price", s_price);
        
        
        SQLList<SQLMap> s_hour=mapper.s_hour(params);
        result.put("s_hour", s_hour);
        
        return result;
    }
    /**
    查看清单
    */
    
    public Map inventoryMateriel() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_set=mapper.s_set(params);
        result.put("s_set", s_set);
        
        
        SQLList<SQLMap> s_price=mapper.s_price(params);
        result.put("s_price", s_price);
        
        
        SQLList<SQLMap> s_hour=mapper.s_hour(params);
        result.put("s_hour", s_hour);
        
        return result;
    }
    /**
    仓库布局设置
    */
    
    public Map warehouseSet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_store_house=mapper.s_store_house(params);
        result.put("s_store_house", s_store_house);
        
        
        SQLList<SQLMap> s_firm=mapper.s_firm(params);
        result.put("s_firm", s_firm);
        
        return result;
    }
    /**
    设置布局图
    */
    
    public Map warehouseSetLayout() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_store_house=mapper.s_store_house(params);
        result.put("s_store_house", s_store_house);
        
        
        SQLList<SQLMap> s_firm=mapper.s_firm(params);
        result.put("s_firm", s_firm);
        
        
        
        
        SQLList<SQLMap> s_layout=mapper.s_layout(params);
        result.put("s_layout", s_layout);
        
        return result;
    }
    /**
    仓库设置
    */
    
    public Map warehouseUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_hours=mapper.t_hours(params);
        SQLMap t_hours_emt=t_hours.getExistfirst();
        result.put("t_hours", t_hours_emt);
        
        return result;
    }
    /**
    设置行数
    */
    
    public Map warehouseRows() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_district=mapper.s_district(params);
        result.put("s_district", s_district);
        
        return result;
    }
    /**
    布局图明细
    */
    
    public Map layoutViewDet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        
        
        
        SQLList<SQLMap> layout=mapper.layout(params);
        SQLMap layout_emt=layout.getExistfirst();
        result.put("layout", layout_emt);
        
        
        SQLList<SQLMap> layout_item=mapper.layout_item(params);
        result.put("layout_item", layout_item);
        
        return result;
    }
    /**
    仓库布局图
    */
    
    public Map layoutViewDetTest() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        
        
        
        SQLList<SQLMap> layout=mapper.layout(params);
        SQLMap layout_emt=layout.getExistfirst();
        result.put("layout", layout_emt);
        
        
        SQLList<SQLMap> layout_item=mapper.layout_item(params);
        result.put("layout_item", layout_item);
        
        return result;
    }
    /**
    区域详情
    */
    
    public Map layoutRegionView() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_district=mapper.t_district(params);
        SQLMap t_district_emt=t_district.getExistfirst();
        result.put("t_district", t_district_emt);
        
        
        SQLList<SQLMap> s_staff=mapper.s_staff(params);
        result.put("s_staff", s_staff);
        
        return result;
    }
    /**
    设置区域
    */
    
    public Map warehouseRegion() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_district=mapper.s_district(params);
        result.put("s_district", s_district);
        
        return result;
    }
    /**
    区域修改
    */
    
    public Map warehouseRegionUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_item=mapper.t_item(params);
        SQLMap t_item_emt=t_item.getExistfirst();
        result.put("t_item", t_item_emt);
        
        
        SQLList<SQLMap> s_district=mapper.s_district(params);
        result.put("s_district", s_district);
        
        
        SQLList<SQLMap> s_staff=mapper.s_staff(params);
        result.put("s_staff", s_staff);
        
        return result;
    }
    /**
    区域设置行数
    */
    
    public Map wareRowsUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_district=mapper.t_district(params);
        SQLMap t_district_emt=t_district.getExistfirst();
        result.put("t_district", t_district_emt);
        
        return result;
    }
    /**
    修改图片
    */
    
    public Map layoutImUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_layout=mapper.s_layout(params);
        SQLMap s_layout_emt=s_layout.getExistfirst();
        result.put("s_layout", s_layout_emt);
        
        return result;
    }
    /**
    修改布局
    */
    
    public Map layoutViewSet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> layout=mapper.layout(params);
        SQLMap layout_emt=layout.getExistfirst();
        result.put("layout", layout_emt);
        
        
        SQLList<SQLMap> layout_item=mapper.layout_item(params);
        result.put("layout_item", layout_item);
        
        return result;
    }
    /**
    设置库管员
    */
    
    public Map warehouseLibList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_item=mapper.s_item(params);
        result.put("s_item", s_item);
        
        return result;
    }
    /**
    增加库管员
    */
    
    public Map warehouseLibAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_item=mapper.t_item(params);
        SQLMap t_item_emt=t_item.getExistfirst();
        result.put("t_item", t_item_emt);
        
        
        SQLList<SQLMap> s_staff=mapper.s_staff(params);
        result.put("s_staff", s_staff);
        
        return result;
    }
    /**
    添加操作人员
    */
    
    public Map wareStaffChoice() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        SQLList<SQLMap> s_info=mapper.s_info(params,pagination);
        s_info.setPagedListInfo(pagination);
        result.put("s_info", s_info);
        
        
        
        
        SQLList<SQLMap> parent=mapper.parent(params);
        SQLMap parent_emt=parent.getExistfirst();
        result.put("parent", parent_emt);
        
        
        tb = createTreeBean("l_firm_treecols");
        SQLList<SQLMap> l_firm=mapper.l_firm(params);
        l_firm = l_firm.buildTree(tb,tb.getPid());
        result.put("l_firm", l_firm);
        
        return result;
    }
    /**
    盘存流程设置
    */
    
    public Map inventorySettingsSupply() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_step=mapper.s_step(params);
        result.put("s_step", s_step);
        
        return result;
    }
    /**
    盘存流程人员
    */
    
    public Map processPerson() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_step=mapper.s_step(params);
        result.put("s_step", s_step);
        
        return result;
    }
    /**
    公司人员
    */
    
    public Map companyPersonSupply() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        SQLList<SQLMap> s_firm=mapper.s_firm(params);
        result.put("s_firm", s_firm);
        
        
        params.def("CMID1",-1);
        SQLList<SQLMap> s_role=mapper.s_role(params);
        result.put("s_role", s_role);
        
        
        SQLList<SQLMap> s_person=mapper.s_person(params,pagination);
        s_person.setPagedListInfo(pagination);
        result.put("s_person", s_person);
        
        
        
        
        SQLList<SQLMap> parent=mapper.parent(params);
        SQLMap parent_emt=parent.getExistfirst();
        result.put("parent", parent_emt);
        
        
        tb = createTreeBean("l_firm_treecols");
        SQLList<SQLMap> l_firm=mapper.l_firm(params);
        l_firm = l_firm.buildTree(tb,tb.getPid());
        result.put("l_firm", l_firm);
        
        return result;
    }
    /**
    盘存价格设置
    */
    
    public Map priceSetting() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_inventory=mapper.s_inventory(params);
        result.put("s_inventory", s_inventory);
        
        return result;
    }
    /**
    出入库类型设置
    */
    
    public Map warehouseTypeManage() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_inout=mapper.s_inout(params);
        result.put("s_inout", s_inout);
        
        return result;
    }
    /**
    */
    
    public Map d_date() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_date(params);
        
        return result;
    }
    /**
    盘存修改修改
    */
    
    public Map inventoryListUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.inventoryListUpSubmit(params);
        
        return result;
    }
    /**
    盘存日期增加修改
    */
    
    public Map inventoryTimeAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int i = mapper.i(params);
        result.put("i", i);
        
        return result;
    }
    /**
    查看清单修改
    */
    
    public Map inventoryMaterielSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("store_take_set")){
            params=new SQLParam(request,emt.getMap());
            mapper.inventoryMaterielSubmit(params);
        }
        
        return result;
    }
    /**
    设置布局图修改
    */
    
    public Map warehouseSetLayoutSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.warehouseSetLayoutSubmit(params);
        
        
        for (SQLMap emt:hqlBean.getTableElements("store_house")){
            params=new SQLParam(request,emt.getMap());
            mapper.b_store_house(params);
        }
        
        return result;
    }
    /**
    仓库设置修改
    */
    
    public Map warehouseUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.warehouseUpSubmit(params);
        
        return result;
    }
    /**
    设置行数修改
    */
    
    public Map warehouseRowsSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.warehouseRowsSubmit(params);
        
        
        for (SQLMap emt:hqlBean.getTableElements("store_house_district")){
            params=new SQLParam(request,emt.getMap());
            mapper.b_house_district(params);
        }
        
        return result;
    }
    /**
    设置区域修改
    */
    
    public Map warehouseRegionSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.warehouseRegionSubmit(params);
        
        
        for (SQLMap emt:hqlBean.getTableElements("store_house_district")){
            params=new SQLParam(request,emt.getMap());
            mapper.b_house_district(params);
        }
        
        return result;
    }
    /**
    */
    
    public Map d_staff() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_staff(params);
        
        return result;
    }
    /**
    */
    
    public Map u_staff() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.u_staff(params);
        
        return result;
    }
    /**
    区域设置行数修改
    */
    
    public Map wareRowsUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.wareRowsUpSubmit(params);
        
        return result;
    }
    /**
    修改图片修改
    */
    
    public Map layoutImUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int i = mapper.i(params);
        result.put("i", i);
        
        return result;
    }
    /**
    修改布局修改
    */
    
    public Map layoutViewSetSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        XmlParserUtil.parseLayout(context);
        
        
        mapper.layoutViewSetSubmit(params);
        
        
        for (SQLMap emt:hqlBean.getTableElements("layout_item")){
            params=new SQLParam(request,emt.getMap());
            mapper.b_layout_item(params);
        }
        
        return result;
    }
    /**
    添加操作人员修改
    */
    
    public Map wareStaffChoiceSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        Object store_staff_cnt =
        mapper.store_staff_cnt(params);
        result.put("store_staff_cnt", store_staff_cnt);
        
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.b(params);
        }
        
        
        mapper.wareStaffChoiceSubmit(params);
        
        return result;
    }
    /**
    盘存流程人员修改
    */
    
    public Map processPersonSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.processPersonSubmit(params);
        }
        
        return result;
    }
    /**
    */
    
    public Map d_inventory() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_inventory(params);
        
        return result;
    }
    /**
    增加价格修改
    */
    
    public Map increasePriceAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int i = mapper.i(params);
        result.put("i", i);
        
        return result;
    }
    /**
    */
    
    public Map d_inout() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_inout(params);
        
        return result;
    }
    /**
    增加出入库类型修改
    */
    
    public Map warehouseTypeAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int CMID = mapper.CMID(params);
        result.put("CMID", CMID);
        
        return result;
    }
}